<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>创作</title>
    <link rel="shortcut icon" href="./img/logo.jpg">
    <link rel="stylesheet" href="css/blog.css">
    <link rel="stylesheet" href="css/blog_edit.css">
    <!-- 引入 editor.md 的依赖 -->
    <link rel="stylesheet" href="editor.md/css/editormd.min.css" />
    <script src="js/jquery-2.2.4.min.js"></script>
    <script src="editor.md/lib/marked.min.js"></script>
    <script src="editor.md/lib/prettify.min.js"></script>
    <script src="editor.md/editormd.js"></script>
</head>

<body>
    <!-- 导航栏 -->
    <div class="nav">
        <img src="./img/logo.jpg" alt="">
        <span class="title">博客系统</span>

        <!-- 用来占据中间位置 -->
        <span class="spacer"></span>
        <a href="blog_list.html">主页</a>
        <a href="blog_edit.html">创作</a>
        <a href="logout">注销</a>
    </div>

    <!-- 编辑框容器 -->
    <div class="blog-edit-container">
        <form action="blog_edit" method="post" style="height: 100%;">
            <!-- 标题编辑区 -->
            <div class="title">
                <input type="text" id="title" name="title">
                <input type="submit" id="submit" value="发布文章">
            </div>

            <!-- 创建编辑器标签 -->
            <div id="editor">
                <!--同步左侧右侧编辑内容-->
                <textarea name="content" style="display:none ;"></textarea>
            </div>
        </form>
        
    </div>

    <script>
        //表示右侧内容为markdown形式
        var editor = editormd("editor", {
            width: "100%",
            height: "calc(100% - 50px)",
            markdown: "# 在此处编写博客正文",
            path: "editor.md/lib/",
            saveHTMLToTextarea:true
        });
    </script>
</body>

</html>